import { useSelector, useDispatch } from "react-redux";
import { toggleSidebar } from "@/store/actions/app";

export default function useCollapsed() {
  const collapsed = useSelector((state) => state.app.collapsed);
  const dispatch = useDispatch();
  const setCollapsed = () => {
    dispatch(toggleSidebar());
  };
  return {
    collapsed,
    setCollapsed,
  };
}
